package model.forview;

import java.util.ArrayList;

import model.wrap.type.Type;
import models.ConstantName;
import models.ConstantValue;

/**
 * /GET /type?idType=Long
 * 
 * @author pocteg
 * 
 */
public class TypeModelForView extends ContentForMainTemplate
{
    /**
     *********** ATTRIBUTS******************************************************
     * 
     * -------------------INSTANCE---------------------------------------------
     * 
     * -----------------------------PUBLIC-------------------------------------
     */

    public Type vType;
    public ArrayList<String> simpleTypesName;
    public ArrayList<String> simpleTypesTitle;

    /**
     * -----------------------------PROTECTED----------------------------------
     */

    /**
     * -----------------------------PRIVATE------------------------------------
     */

    /**
     ********************* STATIC**********************************************
     * 
     * -----------------------------PUBLIC------------------------------------
     */

    /**
     * -----------------------------PROTECTED---------------------------------
     */

    /**
     * -----------------------------PRIVATE-----------------------------------
     */

    /**
     *********** CONSTRUCTOR***************************************************
     */

    public TypeModelForView(Type type)
    {
	this.vType = type;
	setDefaultValues();
	setSimpleTypes(this.vType);
    }

    /**
     *********** METHODS*******************************************************
     * 
     * -------------------INSTANCE--------------------------------------------
     * 
     * -----------------------------PUBLIC------------------------------------
     */

    /**
     * -----------------------------PROTECTED---------------------------------
     */

    /**
     * -----------------------------PRIVATE-----------------------------------
     */

    private void setDefaultValues()
    {
	String title = ConstantValue.getConstantValue(ConstantName.TYPE_PAGE_TITLE);
	String header = ConstantValue.getConstantValue(ConstantName.TYPE_PAGE_HEADER);
	String footer = ConstantValue.getConstantValue(ConstantName.TYPE_PAGE_FOOTER);
	String userName = "";

	title = title != null ? title : "Информация о типе данных";
	header = header != null ? header : "Информация о типе данных";
	footer = footer != null ? footer : "Информация о типе данных";

	mainModelForView = new MainModelForView(title, userName, header, footer);
    }

    private void setSimpleTypes(Type type)
    {
	this.simpleTypesName = type.getSimpleTypesNameTitle();
	this.simpleTypesTitle = type.getSimpleTypesTitle();
    }

    /**
     ********************* STATIC**********************************************
     * 
     * -----------------------------PUBLIC------------------------------------
     */

    /**
     * -----------------------------PROTECTED---------------------------------
     */

    /**
     * -----------------------------PRIVATE-----------------------------------
     */

    /**
     ****** GETTERS************************************************************
     */

    /**
     ****** SETTERS************************************************************
     */

}
